import java.util.Arrays;

public class Test {
    public static int[] func(int[] num, int target){
        for (int i = 0; i < num.length-1; i++) {
            for (int j = i+1; j < num.length; j++) {
                if(num[i]+num[j]==target){
                    return new int[] {i,j};
                }
            }
        }
        return new int[] {-1,-1};
    }
    public static void main(String[] args) {
        int[] num = {2,7,11,15};
        int target = 9;
        int[] arr = func(num,target);
        System.out.println(Arrays.toString(arr));
    }
}
